<?php

/*
 * Exports translated data to PHP constants
 *
 *
 * @uses classes/babel/Translation_Tasks.php
 * @package BABEL
 * @since   BABEL 0.1.0
 * @version $Id: translate.php 766 2008-05-14 08:52:59Z bjori $
 * @copyright Copyright (C) 2008 Hannes Magnusson
 * @author  Hannes Magnusson
 * @license LGPL
 */


include "includes/babel/prepend_no_gui.php";
include "classes/babel/Translation_Tasks.php";

restore_error_handler();
restore_exception_handler();

try {
	$task = Babel_Translation_Task::getTaskByID((int)$_GET["langid"], (int)$_GET["constid"]);
} catch(Exception $task) {
}

$serialize = "php";
if (isset($_GET["serialize"])) {
	$serialize = $_GET["serialize"];
}

switch($serialize) {
	case "xml":
		break;
	case "json":
		echo json_encode($task);
		break;

	case "php":
	default:
	echo serialize($task);
}

